package com.mycity.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.ResultSetExtractor;

import com.mycity.bean.Post;

public class PostSetExtractor implements ResultSetExtractor<Post> {

	  @Override
	  public Post extractData(ResultSet rs) throws SQLException {
	    Post post = new Post();
	    post.setUserId(rs.getInt("userId"));
	    post.setPostType(rs.getInt("postType"));
	    post.setPostId(rs.getInt("postId"));
	    post.setPostDate(rs.getString("postDate"));
	    post.setPostContent(rs.getString("postContent"));
	    post.setLocationId(rs.getInt("locationId"));
	    post.setLocationName(rs.getString("locationName"));
	    return post;
	  }
}